home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 15 / CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso / CUCD / Graphics / Ghostscript / source / iutil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-14  |  3.7 KB  |  102 lines

  1. /* Copyright (C) 1991, 1995 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* iutil.h */
  20. /* Prototypes for procedures in iutil.c */
  21. /* Requires imemory.h, ostack.h */
  22.  
  23. /* ------ Object utilities ------ */
  24.  
  25. /* Copy refs from one place to another. */
  26. /* (If we are copying to the stack, we can just use memcpy.) */
  27. void refcpy_to_new(P3(ref *to, const ref *from, uint size));
  28. int refcpy_to_old(P5(ref *aref, uint index, const ref *from, uint size, client_name_t cname));
  29.  
  30. /* Fill an array with nulls. */
  31. void refset_null(P2(ref *to, uint size));
  32.  
  33. /* Compare two objects for equality. */
  34. bool obj_eq(P2(const ref *, const ref *));
  35.  
  36. /* Compare two objects for identity. */
  37. /* (This is not a standard PostScript concept.) */
  38. bool obj_ident_eq(P2(const ref *, const ref *));
  39.  
  40. /*
  41.  * Create a printable representation of an object, a la cvs (full_print =
  42.  * false) or == (full_print = true).  Return 0 if OK, <0 if the destination
  43.  * wasn't large enough or the object's contents weren't readable.
  44.  * If the object was a string or name, store a pointer to its characters
  45.  * even if it was too large.  Note that if full_print is true, the only
  46.  * allowed types are boolean, integer, and real.
  47.  */
  48. int obj_cvp(P6(const ref *op, byte *str, uint len, uint *prlen,
  49.            const byte **pchars, bool full_print));
  50. #define obj_cvs(op, str, len, prlen, pchars)\
  51.   obj_cvp(op, str, len, prlen, pchars, false)
  52.  
  53. /* Get an element from an array (packed or not). */
  54. int array_get(P3(const ref *, long, ref *));
  55.  
  56. /* Get an element from a packed array. */
  57. /* (This works for ordinary arrays too.) */
  58. /* Source and destination are allowed to overlap if the source is packed, */
  59. /* or if they are identical. */
  60. void packed_get(P2(const ref_packed *, ref *));
  61.  
  62. /* Check to make sure an interval contains no object references */
  63. /* to a space younger than a given one. */
  64. /* Return 0 or e_invalidaccess. */
  65. int refs_check_space(P3(const ref *refs, uint size, uint space));
  66.  
  67. /* ------ String utilities ------ */
  68.  
  69. /* Convert a C string to a string object. */
  70. int string_to_ref(P4(const char *, ref *, gs_ref_memory_t *, client_name_t));
  71.  
  72. /* Convert a string object to a C string. */
  73. /* Return 0 iff the buffer can't be allocated. */
  74. char *ref_to_string(P3(const ref *, gs_memory_t *, client_name_t));
  75.  
  76. /* ------ Operand utilities ------ */
  77.  
  78. /* Get N numeric operands from the stack or an array. */
  79. int num_params(P3(const ref *, int, float *));
  80.  
  81. /* Get a single real parameter. */
  82. /* The only possible error is e_typecheck. */
  83. int real_param(P2(const ref *, float *));
  84.  
  85. /* Get an integer parameter in a given range. */
  86. int int_param(P3(const ref *, int, int *));
  87.  
  88. /* Make real values on the stack. */
  89. void make_reals(P3(ref *, const float *, int));
  90.  
  91. /* Define the gs_matrix type if necessary. */
  92. #ifndef gs_matrix_DEFINED
  93. #  define gs_matrix_DEFINED
  94. typedef struct gs_matrix_s gs_matrix;
  95. #endif
  96.  
  97. /* Read a matrix operand. */
  98. int read_matrix(P2(const ref *, gs_matrix *));
  99.  
  100. /* Write a matrix operand. */
  101. int write_matrix(P2(ref *, const gs_matrix *));
  102.